package com.ruoyi.service.impl;
import com.ruoyi.domain.CategoryTwo;
import com.ruoyi.mapper.CategoryTwoMapper;
import com.ruoyi.service.ICategoryTwoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryTwoServiceImpl implements ICategoryTwoService {
    @Autowired
    CategoryTwoMapper categoryTwoMapper;

    @Override
    public List<CategoryTwo> list() {
        return categoryTwoMapper.selectList();
    }

    @Override
    public CategoryTwo getById(Long id) {
        return categoryTwoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int save(CategoryTwo categoryTwo) {
        return categoryTwoMapper.insertSelective(categoryTwo);
    }

    @Override
    public int updateById(CategoryTwo categoryTwo) {
        return categoryTwoMapper.updateByPrimaryKeySelective(categoryTwo);
    }
}
